﻿#include "ZBorderEffect.h"
#include <QColor>

class ZBorderEffectPrivate
{
public:
    ZBorderEffectPrivate()
    {
        m_border_width = 0;
        m_border_color = QColor(Qt::gray);
        m_border_style = Qt::SolidLine;
    }

    int             m_border_width;
    QColor          m_border_color;
    Qt::PenStyle    m_border_style;
};

ZBorderEffect::ZBorderEffect(QObject *parent) : QObject(parent)
{
    m_data = new ZBorderEffectPrivate;
}

ZBorderEffect::~ZBorderEffect()
{
    delete m_data;
}

void ZBorderEffect::setBorderWidth(int width)
{
    m_data->m_border_width = qMax(width, 0);
}

int ZBorderEffect::getBorderWidth()
{
    return m_data->m_border_width;
}

void ZBorderEffect::setBorderColor(const QColor &color)
{
    m_data->m_border_color = color;
}

QColor ZBorderEffect::getBorderColor()
{
    return m_data->m_border_color;
}

void ZBorderEffect::setBorderStyle(Qt::PenStyle style)
{
    m_data->m_border_style = style;
}

Qt::PenStyle ZBorderEffect::getPenStyle()
{
    return m_data->m_border_style;
}
